package com.link2room.ironhide.controller.inside;


import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.ironhide.dto.param.inside.L2RCommissionInsideParamDto;
import com.link2room.ironhide.dto.result.base.L2RCommissionDto;
import com.link2room.ironhide.facade.ICommissionFacadeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Created by sss on 2016/8/29.
 */
@Api(tags = "佣金相关")
@RestController
@RequestMapping("/in/Commissions")
public class CommissionInsideController {
    @Resource
    private ICommissionFacadeService commissionFacadeService;

    @RequestMapping(value = "/Commission",method= RequestMethod.GET)
    public @ResponseBody BaseResultDto commission(
            @RequestParam(value = "pbChannel" ,required = true) String pbChannel,
            @RequestParam(value = "resType" ,required = true) String resType
    ) throws Exception {
        L2RCommissionInsideParamDto l2RCommissionInsideParamDto=new L2RCommissionInsideParamDto();
        l2RCommissionInsideParamDto.setResType(resType);
        l2RCommissionInsideParamDto.setPbChannel(pbChannel);
        L2RCommissionDto commission = commissionFacadeService.findCommission(l2RCommissionInsideParamDto);
        BaseResultDto l2rRs=new BaseResultDto();
        l2rRs.setResultCode(0);
        l2rRs.setResultInfo(commission);
        return l2rRs;
    }

}
